package org.omg.IOP;

/**
 *	Generated from IDL definition of struct "ServiceContext"
 *	@author IDL compiler 
 */

public class ServiceContextHelper
{
//	private static org.omg.CORBA.TypeCode _type = org.omg.CORBA.ORB.init().create_struct_tc(org.omg.IOP.ServiceContextHelper.id(),"ServiceContext",new org.omg.CORBA.StructMember[]{new org.omg.CORBA.StructMember("context_id",org.omg.CORBA.ORB.init().create_alias_tc( org.omg.IOP.ServiceIdHelper.id(),"ServiceId",org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(5))),null),new org.omg.CORBA.StructMember("context_data",org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(10))),null)});
	private static org.omg.CORBA.TypeCode _type;
	public ServiceContextHelper ()
	{
	}
	public static void insert(org.omg.CORBA.Any any, org.omg.IOP.ServiceContext s)
	{
		any.type(type());
		write( any.create_output_stream(),s);
	}
	public static org.omg.IOP.ServiceContext extract(org.omg.CORBA.Any any)
	{
		return read(any.create_input_stream());
	}
	public static org.omg.CORBA.TypeCode type()
	{
		return _type;
	}
	public static String id()
	{
		return "IDL:omg.org/IOP/ServiceContext:1.0";
	}
	public static org.omg.IOP.ServiceContext read(org.omg.CORBA.portable.InputStream in)
	{
		org.omg.IOP.ServiceContext result = new org.omg.IOP.ServiceContext();
		result.context_id=in.read_ulong();
		int _lresult_context_data4 = in.read_long();
		result.context_data = new byte[_lresult_context_data4];
	in.read_octet_array(result.context_data,0,_lresult_context_data4);
		return result;
	}
	public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.IOP.ServiceContext s)
	{
		out.write_ulong(s.context_id);
		
		out.write_long(s.context_data.length);
		out.write_octet_array(s.context_data,0,s.context_data.length);
	}
}
